﻿using Prism.Commands;
using Prism.Services.Dialogs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WpfApp_SmartParking.ViewModels.Dialog;

public class DetailViewModelBase : IDialogAware
{
    public string Title { get; set; } = "";

    public event Action<IDialogResult>? RequestClose;

    public DelegateCommand? SubmitCommand { get; set; }

    public DelegateCommand? CancelCommand { get; set; }

    public virtual bool CanCloseDialog()
    {
        return true;
    }

    public virtual void OnDialogClosed()
    {
        
    }

    public virtual void OnDialogOpened(IDialogParameters parameters)
    {
        
    }

    public void CloseWindow(IDialogResult dialogResult)
    {
        RequestClose?.Invoke(dialogResult);
    }
}
